home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 2 / MacAddict_002_1996_10.iso / Shareware / Creative Tools / BBEdit Lite 3.5.1 / BBEdit Lite Quickstart < prev    next >
Text File  |  1996-01-02  |  42KB  |  945 lines

  1. This QuickStart document provides a brief overview of some of the
  2. commands available in BBEdit Lite. For more general information about
  3. BBEdit Lite, consult the "About BBEdit Lite" document.
  4.  
  5. The topics covered in this document are:
  6.  
  7.     * Installation
  8.     * Creating and Saving Documents
  9.     * Editing Documents
  10.         - Key Equivalents
  11.     * More on Wrapping
  12.     * Printing
  13.     * Searching
  14.     * Multi-File Searching
  15.     * Preferences Dialog
  16.     * Parting Shots
  17.  
  18. ---
  19.  
  20. Installation
  21.  
  22. BBEdit Lite consists of the following major components:
  23.  
  24. *    The BBEdit Lite application itself
  25. *    The "BBEdit Extensions" folder, which contains plug-in code
  26.       modules that can provide specialized text processing or
  27.       utility functions 
  28.  
  29. Only the BBEdit Lite application file is required in order to run and
  30. use BBEdit Lite; you do not need to have any BBEdit extensions.
  31.  
  32. If you are planning to install the whole set of BBEdit Lite files,
  33. create a "BBEdit Lite Folder". Copy the application and the "BBEdit
  34. Extensions" folder into your BBEdit Lite Folder.
  35.  
  36. ---
  37.  
  38. Creating and Saving Documents
  39.  
  40. To create a new document within BBEdit Lite, choose "New" from the File
  41. menu. An empty editing window will be opened on the screen. You can type
  42. in this window, paste text from another document or application, or do
  43. anything else which causes text to be placed in this window.
  44.  
  45. If you are using System 6 or System 7, you can use the Finder to open
  46. files created by BBEdit Lite by double-clicking on them.
  47.  
  48. Once you have opened a new window and done some basic editing, you can
  49. save your new document. To do this, choose the "Save As..." command from
  50. the File menu. Type in the name of your new file and click on "Save".
  51.  
  52. ---
  53.  
  54. Editing Documents
  55.  
  56. In terms of its basic editing functionality, BBEdit Lite behaves like any
  57. other word processor or text editor on the Macintosh: any typed
  58. characters are inserted at the insertion point; if there is a selection
  59. present, the selection is replaced by the first typed character, and the
  60. insertion point is placed after the first typed character.
  61.  
  62. The insertion point is indicated by a blinking vertical bar.
  63.  
  64. If there is any text selected in the active (or front) window, it is
  65. highlighted using your Mac's default highlight color. If there is text
  66. selected in a window that is inactive (not the front window), it is
  67. framed in the highlight color.
  68.  
  69. As you type, BBEdit Lite scrolls the window's contents so that the insertion
  70. point is visible. Unless you have the "Soft Wrap Text" option selected,
  71. the window may scroll horizontally as you type.
  72.  
  73. To move text from one place to another, select the text you wish to
  74. move, and choose the "Cut" command from the Edit menu. The selected text
  75. will be deleted, and placed in a special area called the "Clipboard".
  76. (The Clipboard always contains the last text that you cut or copied.)
  77. You can then use the "Paste" command on the Edit menu to place the text
  78. elsewhere in the document you are editing, or even in another window
  79. altogether. Also, any text that you cut or copy can be pasted into
  80. another application. You can place text in the Clipboard without
  81. deleting it by choosing "Copy" from the Edit menu.
  82.  
  83. When you Paste, the text that's in the Clipboard will replace the
  84. current selection (if there is one), or be inserted at the insertion
  85. point. Paste doesn't remove text from the Clipboard, so you can Paste as
  86. many times as you wish.
  87.  
  88. To delete selected text, hit the "Delete" key on your keyboard, or
  89. choose "Clear" from the Edit menu. If you have a keyboard with a numeric
  90. keypad on it, you can hit the "Clear" key on the keypad to delete the
  91. selected text.
  92.  
  93. To select all the text in the front editing window, choose "Select All"
  94. from the Edit menu. You can then cut, copy, or perform any other action
  95. that affects selected text.
  96.  
  97. BBEdit Lite provides an assortment of facilities for transforming text in
  98. various ways. The commands to transform text are all found under the
  99. Text menu:
  100.  
  101. *   Balance locates the pair of parentheses, braces, or brackets which
  102. encloses the current selection range or insertion point. If there are
  103. unmatched parentheses, braces, or brackets, BBEdit Lite will beep.
  104.  
  105. *   Twiddle transposes the two characters on either side of the
  106. insertion point, or at either end of the selected text.
  107.  
  108. *   Change Case... allows you to automatically switch between upper and
  109. lower case characters for entire words, first letters of words, or first
  110. letters of lines.
  111.  
  112. *   Shift Left and Shift Right indent the selected text by one tab stop
  113. (in the case of Shift Left), or outdent by one tab stop (for Shift
  114. Right). If you hold down the Shift key while choosing one of these
  115. commands, the selected text will be indented or outdented by one space
  116. instead of one tab stop.
  117.  
  118. *   The Hard Wrap... command is used for wrapping long lines of text and
  119. filling paragraphs. Essentially, it uses carriage returns to break lines
  120. of text, to keep them from running off to the right of your screen.
  121.  
  122. *   Unwrap... removes carriage returns and spaces between groups of text.
  123. Essentially, it performs the reverse function of the "Hard Wrap..."
  124. command.
  125.  
  126. *   Zap Gremlins... is useful for finding and altering non-printing
  127. characters in your text files.
  128.  
  129. *   Entab converts runs of spaces into tabs, according to the current
  130. setting in the "Font and Tabs..." dialog. This transformation is useful
  131. when downloading text from a mainframe computer or on-line service which
  132. uses spaces to line up columns of text; when displaying the text in a
  133. monospaced font, columns will still usually not line up unless you Entab
  134. the text.
  135.  
  136. *   Detab converts tabs into runs of spaces, according to the current
  137. setting in the "Font and Tabs..." dialog. This is useful when uploading
  138. text to a mainframe or on-line service which has no concept of tabs as
  139. column separators.
  140.  
  141.  
  142. Additional Menu Items
  143.  
  144. Here is a listing of some of the additional functions (or changes to the
  145. behavior of existing functions) which can be invoked by using various
  146. modifier keys. Please remember that BBEdit Lite displays the modified
  147. names of these commands in its menus, so to see the commands in context,
  148. just pull down the menu and press one or more modifier keys.
  149.  
  150.  
  151. Menu    Item            Modifier    New Name            Action
  152. ----    ----            --------    --- ----            ------
  153. File    Open            Option      Open Several        Open several
  154.                                                         documents in
  155.                                                         one dialog
  156.  
  157.         Close           Option      Close All           Closes all
  158.                                                         open documents
  159.  
  160.         Save            Option      Save All            Saves all unsaved
  161.                                                         documents
  162.  
  163.         Save As..       Option      Save As Selection.. Uses selection
  164.                                                         as default name
  165.                                                         for Save As
  166.  
  167.         Print..         Option      Print All..         Prints all open
  168.                                                         documents
  169.  
  170.         Quit..          Option      Transfer..          Run another
  171.                                                         application
  172.  
  173. Edit    Cut             Shift       Cut & Append        Cut & Add to
  174.                                                         Clipboard
  175.  
  176.         Copy            Shift       Copy & Append       Add to Clipboard
  177.  
  178.         Select Line     Option      Select Paragraph    Selects paragraph
  179.                                                         containing current
  180.                                                         line
  181.                                                         
  182. Text    Twiddle         Option      Twiddle Words       Exchange words
  183.  
  184.         Change Case..   Option      Change Case         Use current
  185.                                                         settings
  186.  
  187.         Shift Left      Shift       Shift Left One Space
  188.  
  189.         Shift Right     Shift       Shift Right One Space   
  190.     
  191.         Wrap..          Option      Wrap                Wrap with
  192.                                                         current settings
  193.  
  194.         Unwrap..        Option      Unwrap              Unwrap with
  195.                                                         current settings
  196.  
  197.         Zap "Gremlins"..Option      Zap "Gremlins"      Zap with
  198.                                                         current settings
  199.  
  200.         Entab..         Option      Entab               Use current
  201.                                                         settings
  202.  
  203.         Detab..         Option      Detab               Use current
  204.                                                         settings
  205.     
  206. Search  Enter           Option      Enter
  207.         Search String               Replace String
  208.  
  209.         Find in         Option      Open All Matches    Find in Next File
  210.         Next File                                       until no more found
  211.  
  212.  
  213. Cursor Key Equivalents
  214.  
  215. Sometimes, you may find prefer to do word selection or deletion 
  216. directly from the keyboard. Here are some available shortcuts:
  217.  
  218. Key                        Modifier          Action
  219. ---                        --------        ------
  220. (left/right) Arrow        (none)            Move 1 character left/right
  221.  
  222. (left/right) Arrow        Option            Move 1 word left/right
  223.  
  224. (left/right) Arrow        Command            Move to beginning/end of line
  225.  
  226. (up/down) Arrow              (none)            Move up/down 1 line in file
  227.  
  228. (up/down) Arrow              Option            Move to top/bottom of file
  229.  
  230. (up/down) Arrow             Command            Move to previous/next screen page
  231.  
  232. [any of the above]        Shift            Make or extend a selection range
  233.  
  234. Delete                       (none)            Deletes characters backward
  235.                                         (toward beginning of line)
  236.  
  237. There is an option to "Exchange Command & Option" key effects in the
  238. Editor section of the Preferences, for those who may be used to some
  239. older environments which behaved this way. If this option is activated,
  240. the above key equivalents will change accordingly.
  241.  
  242.  
  243. Special Keys
  244.  
  245. The Apple Extended Keyboard has additional function keys on it, which are
  246. usable within BBEdit Lite:
  247.  
  248. Key                    Action
  249. ---                    ------
  250. F1                    Undo
  251.  
  252. F2                    Cut
  253.  
  254. F3                    Copy
  255.  
  256. F4                    Paste
  257.  
  258. "del"                Forward Delete
  259.  
  260. Home/End            Scroll to start/end of document
  261.  
  262. Cmd-Home/End        Move insertion point to start/end of document
  263.  
  264. Page Up/Down        Scroll up/down a page
  265.     
  266.  
  267. ---
  268.  
  269. More on Wrapping
  270.  
  271. BBEdit Lite offers the capability to wrap text in a variety of ways. One
  272. method of wrapping is the "soft" or "live" word wrapping that
  273. word-processors provide;  it is useful when importing text files from
  274. word processors or other programs that do not use carriage returns to
  275. break lines on the screen. When opened, such files appear to have only a
  276. few lines in them, which run far past the right-hand edge of the window.
  277. Soft text wrapping is also useful when you are writing text that will
  278. be exported to a word processor or page-layout program, as well as in
  279. other situations in which paragraphs are separated by carriage returns.
  280.  
  281. For composing text in situations where carriage returns are a line
  282. separator (rather than a paragraph separator), "hard" text wrapping is
  283. useful for formatting your text.
  284.  
  285. To hard-wrap text in the current document window, choose "Wrap..." from
  286. the Text menu.
  287.  
  288. The controls on the left half of the "Wrap..." dialog box control how much
  289. of the text is wrapped, and the maximum length of the lines after
  290. wrapping.
  291.  
  292. The group of radio buttons controls the length of lines after they have
  293. been wrapped:
  294.  
  295. *    The "Philip Bar" button will break lines of text at the philip bar.
  296. (To see the location of the philip bar, turn on "Show Philip Bar" in the
  297. Windows section of the Preferences dialog.) The philip bar indicates the
  298. maximum usable width of adocument window when the window is zoomed to
  299. full size on a nine-inch "classic" Macintosh screen. For this reason,
  300. you are guaranteed that text wrapped to the philip bar will be readable
  301. without horizontal scrolling by anyone on any Macintosh.
  302.  
  303. *    If "Window Width" is selected, no wrapped line will be longer than
  304. the current width of the window. This option is useful if you'd like the
  305. lines to be alittle longer or a little shorter than is provided for by
  306. the philip bar; just size the window appropriately and wrap.
  307.  
  308. *    If "Character Width" is selected, the number in the text field
  309. designates the maximum number of characters allowed on any line; a line
  310. that exceeds this number of characters in length will be wrapped. The
  311. "Character Width" setting is useful for preparing postings to on-line
  312. services, which can break lines in an unattractive fashion if they're
  313. longer than a fixed number of characters (usually 80).
  314.  
  315. The controls on the right half of the dialog control paragraph wrapping.
  316. If the "Paragraph Fill" check box is turned off, long lines will be
  317. wrapped. Short lines will be left untouched.
  318.  
  319. ---
  320.  
  321. Printing
  322.  
  323. BBEdit Lite offers a variety of options for varying your printed output.
  324. These options are available from the dialog that appears when you choose
  325. "Print" from the File menu:
  326.  
  327. The portion of the dialog above the gray line is the normal set of
  328. controls that is provided by whichever printer driver you use. Below the
  329. gray line are controls provided specifically by BBEdit Lite.
  330.  
  331. *    The "Printing Font:" button will bring up a dialog that allows you
  332. to set the font, size, style, and tab attributes for the text when it's
  333. printed (as opposed to when it's displayed). For a description of the
  334. controls in this dialog, see the "Editing" section of this document.
  335.  
  336. *    The "Options..." button will present a dialog box for setting various
  337. formatting options, most of which should be self-explanatory.
  338.  
  339. Most of the options in "Options..." dialog only affect the appearance of
  340. the pages that are printed out, and can therefore be set according to
  341. your individual taste.
  342.  
  343. ---
  344.  
  345. Searching
  346.  
  347. BBEdit Lite gives you the ability to search for strings of characters
  348. within the current document, or within multiple files, whether they're
  349. currently open in BBEdit Lite or not. When you choose "Find..." from the
  350. Search menu, BBEdit Lite will present a dialog box with several options.
  351.  
  352. The edit field to the right of "Search For:" contains the string of
  353. characters that you wish to search for. If the "Grep" check box is
  354. checked, the string in this edit field is a regular expression. See
  355. below for more information on grep searching.
  356.  
  357. The edit field to the right of "Replace With:" contains the string of
  358. characters that will replace the current selection whenever you choose
  359. "Replace", "Replace and Find Again", or "Replace All" from the Search
  360. menu.
  361.  
  362. Note: To search for an explicit carriage return, line feed, or tab, you
  363. can type the literal character by holding down the Command key and
  364. hitting the Return or Tab key, or typing "\n" for a line feed, "\r" for
  365. a carriage return, or "\t" for a tab. You can also type Control-J,
  366. Control-M, and Control-I, respectively. To search for a -literal-
  367. occurrence of an escape (for example, in C or Rez program source), use
  368. two backslashes: "\\n", "\\r", and "\\t". Also, a "\\" will be
  369. interepreted to mean a single backslash, just as it does in C.
  370.  
  371. The "Match Case" check box determines whether the search is
  372. case-sensitive or not. If "Match Case" is checked, only text which has
  373. the same combination of upper and lower case letters as the Search For
  374. string will be found.
  375.  
  376. The "Entire Word" check box determines whether the text being searched
  377. must be bounded by word breaks (spaces, dashes, and other punctuation).
  378.  
  379. The "Start at Top" check box will cause the entire document to be
  380. searched, starting at the beginning of the document and proceeding
  381. forward to the end of the document.
  382.  
  383. The "Wrap Around" check box will cause the entire document to be
  384. searched, regardless of where the current insertion point or selection
  385. range lies. Ordinarily, only the text from the start of the selection
  386. range to the end of the document is searched. If "Wrap Around" is turned
  387. on, and the search string isn't found between the start of the selection
  388. range and the end of the document, the search will automatically restart
  389. from the beginning of the document. If the search string is found in the
  390. document after wrapping around, BBEdit Lite will blink the menu bar to alert
  391. you.
  392.  
  393. If the "Search Backwards" check box is checked, BBEdit Lite will search
  394. backwards from the start of the insertion point to the start of the
  395. document, rather than forward to the end of the document. If "Wrap
  396. Around" is checked, and the search string is not found between the start
  397. of the document and the start of the selection range, the backwards
  398. search will resume from the end of the document.
  399.  
  400. If the "Selection Only" check box is checked, BBEdit Lite will search only the
  401. selected range of text.
  402.  
  403. Note: If "Start at Top" is checked, the "Search Backwards", "Selection
  404. Only", and "Wrap Around" options are automatically disabled.
  405.  
  406. After you have entered the search and replace strings and set the search
  407. options appropriately, you can click any of the buttons arrayed along
  408. the right-hand edge of the dialog:
  409.  
  410. -    If you click "Find", BBEdit Lite will search for the current search
  411.     string, using the current search options.
  412.  
  413. -    If you click "Find All", BBEdit Lite will locate all occurrences of the
  414.     search string, using the current search options, and display those
  415.     occurrences in a "Search Results" window.
  416.     
  417. -    If you click "Replace", BBEdit Lite will search for the next occurrence
  418.     of the search string, using the current search options, and replace
  419.     it with the specified replace string.
  420.  
  421. -    If you click "Replace All", BBEdit Lite will locate all occurrences of
  422.     the search string, and replace them with the specified replace
  423.     string.
  424.         
  425. -    If you click "Don't Find", BBEdit Lite will accept the current search
  426.     strings and options, but will not perform the search; you can then
  427.     choose "Find Again" from the Search menu to start the search.
  428.  
  429. Note that if the "Multi-File Search" box is checked, the "Find All" and
  430. "Replace All" buttons will operate across all files that BBEdit Lite locates
  431. using the indicated search method and starting point.
  432.  
  433. ---
  434.  
  435. Multi-File Searching
  436.  
  437. BBEdit Lite also provides a variety of means for searching through multiple
  438. text files at one time in order to locate the search string. To perform
  439. a multi-file search, check the "Multi-File Search" check box in the
  440. Find... dialog.
  441.  
  442. The popup menu next to "What:" determines how BBEdit Lite will locate the
  443. files to be searched.
  444.  
  445. There are three ways to locate files:
  446.  
  447. *    Directory Search. When this search method is chosen, BBEdit Lite scans
  448. through the folders starting at the one you choose, and each file that
  449. it encounters will be searched for the search string.
  450.  
  451. *    Open Windows. When you choose this search method, BBEdit Lite searches
  452. for the search string only in document windows that are currently open.
  453. This sort of search is very fast, and may be most convenient if you wish
  454. to limit the scope of your search to a few files.
  455.  
  456. *    Search Results. This search method is only available when the
  457. "Search Results" window is open and contains the results of a previous
  458. Batch Find (see below).
  459.  
  460. The check boxes can be used to tailor the search to your needs:
  461.  
  462. *    Batch Find accumulates the results of the search in progress and
  463. displays them all at once in a Search Results window. If this check box
  464. is not checked, then the multi-file search will stop each time it
  465. encounters a match, and open the file that contains the match.
  466.  
  467. Once the Search Results window is opened, you can single-click on an
  468. entry in the window to display any given match, or double-click on an
  469. entry to open the file containing that match.
  470.  
  471. *    Search Nested Folders causes the Directory Scan search to search
  472. folders which are enclosed in the search's starting directory. If this
  473. check box is turned off, only the files in the starting directory will
  474. be searched.
  475.  
  476. *    Skip (...) Folders causes the Directory Scan to skip folders whose
  477. names are enclosed in parentheses. This is useful if you have folders
  478. containing text files that you do not want to search for one reason or
  479. another; just enclose the folders' names in parentheses, and they will
  480. be skipped.
  481.  
  482. The "File Type" and "File Name" pop-up menus give you control over the
  483. types of files that BBEdit Lite will search. Choose "Any File" from the menu
  484. to search files of all kinds, regardless of whether they contain actual
  485. text or not. Choose "Text Files" to limit the search to known text
  486. files.
  487.  
  488. When BBEdit Lite performs a multi-file search, it does so in two steps.
  489. First, it constructs a list of the files to be searched, using the
  490. search method specified in the Multi-File Search Options dialog. Second,
  491. it searches each file in the list for the search string. If "Batch Find"
  492. is selected, all occurrences in each file will be displayed in the
  493. Search Results window. Otherwise, each file will be opened to display
  494. the first occurrence of the search string; you can find subsequent
  495. occurrences of the search string in the same file by choosing "Find
  496. Again" from the Search menu. If you are not using Batch Find, you can
  497. locate the next file that contains the search string by choosing "Find
  498. In Next File" from the Search menu.
  499.  
  500. You can combine the capabilities of BBEdit Lite's multi-file search with
  501. the Replace All command to perform multi-file replace operations. To do
  502. this, set up a multi-file search as desired, and click the "Replace All"
  503. button in the Find dialog.
  504.  
  505. Once BBEdit Lite has constructed the list of files to search, it will
  506. present a dialog containing options for the replace operation:
  507.  
  508. There are three levels of safety that are available:
  509.  
  510. *    Safest. Click on the "Leave Open" radio button. For each file that
  511. contains the search string, BBEdit Lite will perform a "Replace All" on that
  512. file, and leave the file open so that you can inspect the changes.
  513.  
  514. *    Less Safe. Click on the "Save To Disk" radio button, and make sure
  515. that the "Confirm Saves" check box is checked. BBEdit Lite will perform a
  516. Replace All on each file that contains the search string, and then ask
  517. you what to do.
  518.  
  519. If you click "Save", BBEdit Lite will save the changed file. If you click
  520. "Don't Save", BBEdit Lite will throw away the changes that were just
  521. performed. If you click "Leave Open", BBEdit Lite will leave the file open;
  522. this is the same behavior as the "Safest" case, above. If you click
  523. "Cancel Search", BBEdit Lite will stop the multi-file replace operation.
  524.  
  525. *    Living on the Edge. Click on the "Save to Disk" radio button, and
  526. un-check the "Confirm Saves" check box. If you do this, BBEdit Lite will
  527. perform a Replace All on each file that contains the search string, and
  528. then save the changed file to disk without asking. You should only use
  529. these settings if you are absolutely certain of what you are doing, since
  530. the changes are irreversible.
  531.  
  532. ---
  533.  
  534. Grep Searching
  535.  
  536. Grep is a method of pattern matching that derives from the Unix(TM)
  537. operating system.  You are probably familiar with simple pattern
  538. matching from using word processors;  when you ask a word processor to
  539. find all instances of the word "black", it is performing a simple
  540. pattern match, where each letter has to match literally.  Matching
  541. strings in this manner is not very hard.
  542.  
  543. The ability to match strings in a more general manner is both more
  544. powerful and more complicated.  It allows for sophisticated pattern
  545. matching operations, such as matching all words that begin with the
  546. letter "P" and end with the letters "er", or deleting the first word of
  547. every line.  Grep provides a powerful means of doing this.
  548.  
  549. To use Grep for searching documents, just check the "Grep" check box in
  550. the Find... dialog.
  551.  
  552. The popup menu next to the "Patterns:" in the dialog contains a list of
  553. your most commonly-used Grep patterns. You can change this list in the
  554. "Grep Patterns" section of the Preferences... dialog.
  555.  
  556.  
  557. How Grep Works
  558.  
  559. The "grep" mode of searching and replacing is a powerful tool. Although
  560. somewhat slower than normal text searching, grep allows the user to
  561. search for one of a set of many strings instead of a particular string. 
  562. As a simple example, you can search for any occurrence of an identifier
  563. beginning with the letter P, or all lines that begin with a left brace.
  564.  
  565. A pattern is a string of characters that, in turn, describes a set of
  566. strings of characters.  An example of a set of strings is the set of all
  567. strings that begin with the letter P and end with the letter r;  the
  568. strings "Ptr" and "ProcPtr" are members of this set.  We say that a
  569. string is matched by a pattern if it is amember of the set described by
  570. the pattern.  Patterns are composed of sub-patterns which are patterns
  571. in themselves;  this is how complicated patterns may be formed.
  572.  
  573. The following section goes through the grep pattern matching and
  574. replacement rules step by step, so that by the end of it you should be
  575. able to understand how each of these grep patterns works and be able to
  576. make your own.
  577.  
  578. In some cases, the state of case sensitivity affects the results of a
  579. pattern match.  We have noted below when this is the case.
  580.  
  581. 1. Any character, with certain exceptions described below, is a pattern
  582. that matches itself.
  583.  
  584. 2.    A pattern x followed by a pattern y forms a pattern xy that matches
  585. any string Bu where B can be matched by x and u can be matched by y.  We
  586. can, of course, take the compound pattern xy and concatenate yet another
  587. pattern z onto it, forming the pattern xyz.
  588.  
  589. 3.    The character . is a pattern that will match any character.
  590.  
  591. 4.    The character \ followed by any character except one of the digits
  592. 1-9 is a pattern that matches that character. (You would use this to
  593. find special characters, such as the . character. To search for a
  594. period, you would use \.).
  595.  
  596. 5.    A string of characters s surrounded by square brackets ([ and a ])
  597. forms a pattern [s] that matches a single instance of one of the
  598. characters in the string s.  Note that the case sensitivity flag does
  599. not apply to characters between square brackets:  letters must match
  600. exactly.
  601.  
  602. 5a.     The pattern [^B] matches any character that is not in the string
  603. B. Special characters will be taken literally in this context.  Again,
  604. case sensitivity doesn't apply to characters between square brackets.
  605.  
  606. 5b.    If a string of three characters in the form [a-b] occurs in the
  607. pattern p, this represents all of the characters from a to b inclusive. 
  608. All special characters are taken literally;  i.e., [!-.] denotes the
  609. characters from ! to .. Notice that the only way to include the
  610. character ] in p is to make it the very first character.  Likewise, the
  611. only way to include the character - in p is to have it either at the
  612. very beginning or the very end of p.  Single characters and ranges may
  613. both be used between brackets.
  614.  
  615. 6a.    Any pattern p formed by any combination of rules 1 or 3-5b
  616. followed by a * forms the pattern p* that matches zero or more
  617. consecutive occurrences of characters matched by p.
  618.  
  619. 6c.    Any pattern p formed by any combination of rules 1 or 3-5b
  620. followed by a ? forms the pattern p? that matches zero or one
  621. consecutive occurrences of characters matched by p.
  622.  
  623. We now have the ability to form patterns that are composed of
  624. sub-patterns, and will find it useful to "remember" sub-strings matched
  625. by sub-patterns and to be able to match against those substrings.
  626.  
  627. 7.    A pattern surrounded by ( and ) is a pattern that matches whatever
  628. the sub-pattern matches.  This is useful for matching two or more
  629. instances of the same string and when doing replacements.
  630.  
  631. Sometimes it is useful to be able to "constrain" patterns to match only if
  632. certain conditions in the context outside the string matched are met.
  633.  
  634. 8.    A pattern p that is preceded by a ^ forms a pattern ^p.  If the
  635. pattern ^p is not preceded by any other pattern, it matches whatever p
  636. matches as long as the first character matched by p occurs at the
  637. beginning of a line.  If the pattern ^p is preceded by another pattern,
  638. then the ^ is taken literally.
  639.  
  640. 9.    A pattern p that is followed by a $ forms a pattern p$.  If the
  641. pattern p$ is not followed by any other pattern, it matches whatever p
  642. matches as long as the last character matched by p occurs at the end of
  643. a line.  If the pattern p$ is followed by another pattern, then the $ is
  644. taken literally.
  645.  
  646. Note that the characters ^ and $ constrain pattern matches to begin or
  647. end at line boundaries, and so can be combined to constrain a pattern to
  648. match an entire line only (as in the above example).
  649.  
  650. Grep provides not only a more sophisticated method of searching, but a
  651. sophisticated method of replacing as well.  In a replacement string, the
  652. following substitutions are made before any text replacement occurs:
  653.  
  654. 1.    Each occurrence of the character & is replaced with whatever was
  655. last matched by the entire pattern.
  656.  
  657. 2.    Each occurrence of a string of the form \n, where n is one of the
  658. digits 1-9, is replaced by whatever was last matched by the sub-pattern
  659. beginning with the nth occurrence of (.
  660.  
  661. 3.    Each occurrence of a string of the form \p, where p is other than
  662. one of the digits 1-9, is replaced by p.
  663.  
  664. This allows you to not only be able to search for a string satisfying a
  665. complex set of conditions, but also to be able to do a subsequent
  666. replacement that varies depending on the string that is matched. Note
  667. that this does not take into account escape sequences, such as \t, \r,
  668. \n, \\, etc. Suppose that you have written a program that is to become a
  669. Macintosh application (i.e., it uses the Macintosh ToolBox instead of
  670. stdio for the user interface).  Suppose also that you have discovered
  671. that you have forgotten to put a \p at the beginning of your string
  672. constants, so that your program is trying to pass C strings instead of
  673. Pascal strings to the Toolbox (which only knows how to deal with Pascal
  674. strings).  You can easily change all your C strings to Pascal strings by
  675. specifying "(.*)" as the search pattern and "\\p\1" as the replacement
  676. string.
  677.  
  678. Suppose you decided to reverse the two arguments of the function "foo". 
  679. You might try the pattern foo\(([^,]*),([^)]*)\) as the search pattern
  680. and foo(\2, \1) as the replacement pattern.  How does the search pattern
  681. work?
  682.  
  683. Let's assume we're trying to match some text that looks like foo(1,*bar)
  684.  
  685.     foo\(([^,]*),([^)]*)\)    matches    foo(1,*bar)
  686.  
  687. Since ([^,]*) matched 1 and ([^)]*) matched *bar, the two arguments to
  688. foo, the replacement pattern foo(\2, \1) will result in foo(*bar, 1)
  689.  
  690. This, unfortunately, won't work in the case of foo(1,(*bar)+2), since
  691. ([^)]*) will match only up to the first right parenthesis, leaving +2)
  692. unmatched.  If we're sure that all calls to foo end with a semicolon,
  693. however, we can change our pattern to foo\(([^,]*),([^;]*)\);. In this
  694. pattern, instead of trying to match the second argument by matching
  695. everything up to the first right parenthesis, we match everything up to
  696. the ); which terminates the invocation of foo.
  697.  
  698. In this example we showed how to analyze a grep pattern by examining
  699. sub-patterns. This is a good way of figuring out how to build a pattern
  700. as well. Grep can be thought of as a small and rather cryptic
  701. programming language, with each pattern a program and sub-pattern a
  702. statement in this language. If you try to create a grep pattern by
  703. testing a small sub-pattern, then adding and testing additional
  704. sub-patterns until the complete pattern is built, you may find building
  705. complex grep patterns not nearly as daunting as you first thought.
  706.  
  707. ---
  708.  
  709. Preferences Dialog
  710.  
  711. To bring up the Preferences dialog, choose "Preferences..." from the Edit
  712. menu, or double-click on your BBEdit Lite Prefs file. (This may not be
  713. convenient, since the BBEdit Lite Prefs file usually resides somewhere within
  714. the System Folder.)
  715.  
  716. The list on the left-hand side of the dialog determines which section of
  717. the preferences you are looking at. If you click on "Save", all of the
  718. preferences settings will be saved to the "BBEdit Lite Prefs" file. If you
  719. click on "Cancel", the existing preferences will be left alone, and any
  720. changes you've made in the Preferences settings will be discarded.
  721.  
  722. --> The "Editor" preferences control BBEdit Lite's editing and keyboard
  723. behavior. These settings establish the defaults for newly-created
  724. documents, as well as for text files that don't already contain BBEdit Lite
  725. state information.
  726.  
  727. *    The "Default Font" button sets the font which will be used to
  728. display the text in newly created windows, and for documents which have
  729. no saved state information.
  730.  
  731. *    If "Auto-Indent" is turned on, BBEdit Lite will indent to the start of
  732. the preceding line whenever you type the "Return" key on the keyboard.
  733. This is useful for programmers and for reverse-indenting text. It may be
  734. less convenient if you are using BBEdit Lite for composing prose.
  735.  
  736. *    Soft Wrap Text: generally, BBEdit Lite does not automatically wrap text
  737. as you type it in, which means the text may scroll horizontally.
  738. Selecting this option tells BBEdit Lite to wrap the text to the width of the
  739. window as you insert and delete text, and whenever you are-size the
  740. document's window.
  741.  
  742. *    If Balance While Typing is turned on, BBEdit Lite will flash matching
  743. parentheses, curly braces, and brackets as you type them.
  744.  
  745. *    Smart Quotes is used to determine the default value of the Smart
  746. Quotes setting for newly created windows and for documents saved with
  747. state information other than "BBEdit Lite".
  748.  
  749. *    Ordinarily, actions such as Entab, Detab, Zap Gremlins, and Replace
  750. All are not undoable, and BBEdit Lite will alert you if you are about to
  751. perform a non-undoable action. If you are not concerned about being able
  752. to undo these actions, and do not want BBEdit Lite to alert you, turn on 
  753. the 'No "Can't Undo" Alerts' check box, and BBEdit Lite will not alert 
  754. you of these actions.
  755.  
  756. *    Exchange Command and Option reverses the meaning of the Command and
  757. Option keys when used with the left and right arrow keys. See "Editing
  758. Text with BBEdit Lite" for more details.
  759.  
  760. *    If Use Keypad for Cursor Control is checked, the keys on the numeric
  761. keypad (on keyboards that have them) will move the cursor. See "Editing
  762. Text With BBEdit Lite" for more details.
  763.  
  764. --> The "File Search" section of the Preferences controls BBEdit Lite's
  765. behavior when searching for files via the "Open Selection" command. If
  766. "Skip (...) Folders" is checked, BBEdit Lite will ignore folders whose
  767. names are enclosed in parentheses. The "Default <...> Directory" setting
  768. determines where BBEdit Lite will start its search of the file's name is
  769. enclosed in <angle brackets>. If "Follow Aliases" is checked, BBEdit
  770. Lite will resolve any folder aliases it encounters during its search.
  771.  
  772. --> The "File Types" section of the Preferences allows you to modify the
  773. list of file creators that appears in the "File Creator" popup menu of
  774. the "Save As..., Options..." dialog box.
  775.  
  776. To add a new application's file creator to the list, click the "Add..."
  777. button, and choose the application. To change an application's creator
  778. signature, click on an application name in the list, enter a new
  779. four-letter code in the text field next to "Creator...", and click the
  780. "Change" button. You can use the "Set button to pick an application and
  781. enter its creator code in the text field for you. To remove an
  782. application creator from the list, click on an application name, and
  783. click the "Delete" button.
  784.  
  785. The creators for "BBEdit Lite" and "Generic Text File" are built into
  786. BBEdit Lite and cannot be changed or deleted.
  787.  
  788. --> The "Filing" settings control the default settings for the Open... and
  789. Open Several... dialogs. If "Wrap TeachText Files" is checked, then BBEdit Lite
  790. Lite will always soft-wrap files which have been created by TeachText
  791. (or its successor SimpleText). If "Auto-Backup" is checked, a backup
  792. will automatically be made of afile every time it is saved.
  793.  
  794. --> The "Grep Patterns" of the Preferences dialog allows you to modify
  795. the list of regular expressions which appears in the popup menu next to
  796. the "Grep" check box in the "Find..." dialog. The scrolling list box shows
  797. the names of the installed patterns. When you click on one, the text
  798. fields below the list will be filled in with its name, search pattern,
  799. and replace pattern. You can change any of these text fields, and click
  800. "Change" to replace the selected pattern with the changed one. You can
  801. also enter new information in the text fields and click "Add" to add a
  802. new pattern, or select a pattern and click "Delete" to remove it from
  803. the list.
  804.  
  805. Note: You can install a pattern with an empty replace pattern, which is
  806. useful just for locating text which matches a particular regular
  807. expression.
  808.  
  809. --> The "Printing" settings provide the default print settings for new
  810. windows and for documents which have saved state information other than
  811. BBEdit Lite's.
  812.  
  813. These settings correspond to the same settings on the "Options..." dialog
  814. which can be brought up from the Print... dialog.
  815.  
  816. --> The "Search Folders" section presents a list of folders which will
  817. appear in the "Folder:" pop-up menu in the "Find" dialog.
  818.  
  819. --> The "Startup" settings determine BBEdit Lite's behavior when it's
  820. launched without any documents.
  821.  
  822. The "At Startup:" radio buttons control what BBEdit Lite does when it's
  823. launched by some means other than double-clicking on a BBEdit Lite document,
  824. or by dragging and dropping some item onto BBEdit Lite itself (under System
  825. 7).
  826.  
  827. *    If Nothing is selected, BBEdit Lite will take no action at startup. This
  828. is handy if BBEdit Lite regularly gets launched into the background, or is
  829. launched by some scripting utility which will then start feeding
  830. commands to BBEdit Lite directly.
  831.  
  832. *    New Window causes BBEdit Lite to bring up a new untitled window, as if
  833. the "New command on the File menu had been chosen.
  834.  
  835. *    Open causes BBEdit Lite to bring up an "Open..." dialog, as if the "Open..."
  836. command on the File menu had been chosen.
  837.  
  838. *    Open Several causes BBEdit Lite to bring up the "Open Several..." dialog,
  839. as if that command had been chosen.
  840.  
  841. --> The "State" settings control what parts of a file's saved state are
  842. honored whenever a file with saved state information is opened. In some
  843. cases, it may be desirable to ignore one of these aspects of the saved
  844. state.
  845.  
  846. The "Remember File State" setting establishes whether BBEdit Lite will
  847. remember information about the document's state (window position, font
  848. and size settings, and other options). This default is applied to newly
  849. created documents. If "Always Add State" is checked, BBEdit Lite will
  850. remember state information for documents that you open which don't
  851. already have saved state information.
  852.  
  853. --> The "Text Search" settings provide the defaults for text searching and
  854. multi-file searching. The options in this dialog correspond to their
  855. counterparts in the Find... and the Multi-File Search Options dialog.
  856.  
  857. The "Start From..." button sets the default starting directory for
  858. Directory Scan multi-file searches.
  859.  
  860. --> The "Windows" settings affect the appearance and behavior of
  861. BBEdit Lite's document windows.
  862.  
  863. *    Delay When Scrolling makes BBEdit Lite wait a tenth of a second when
  864. you click in the arrows of a scrollbar before scrolling the text in a
  865. document window. This is most useful under System 6 on faster machines;
  866. often several lines will go by before your reflexes allow you to let go
  867. of the mouse button. System 7 offers a "scrolling throttle", so this
  868. setting may be turned off.
  869.  
  870. *    Show Status Bar causes the status bar to be visible within all
  871. editing windows. (See "Editing Text With BBEdit Lite" for a description
  872. of the status bar.) This option is on by default; you can turn it off if
  873. you have a small screen and screen "real estate" is at a premium.
  874.  
  875. *    Show Philip Bar draws a vertical gray line in the status bar at the
  876. point where the visible editing area ends on a 9-inch "classic" screen.
  877. See above for more details.
  878.  
  879. *    Show Tab Stops places tick marks in the status bar to indicate the
  880. position of tab stops in each editing window. This option is dimmed if
  881. "Show Status Bar" is turned off.
  882.  
  883. *    Show Line Numbers places line numbers along the left edge of each
  884. editing window.
  885.  
  886. *    Show Cursor Position places the cursor-position display at the
  887. lower left corner of each editing window; this display shows the
  888. position of the insertion point, or the last-changed end of the
  889. selection range.
  890.  
  891. The settings under "Window Zooming" control the maximum width to which
  892. BBEdit Lite will open documents, either by default or when using the
  893. zoom-box control in the upper right-hand corner of the window; the "Zoom
  894. Windows To" setting determines where BBEdit Lite will place windows that
  895. are zoomed on multiple-screen systems.
  896.  
  897. If either of the check boxes under the "Leave Room for Finder" is
  898. checked, BBEdit Lite will make certain that there's enough space below
  899. and/or to the right of any window so that icons on the desktop can be
  900. seen when you are running under MultiFinder or System 7.
  901.  
  902. Note - if you are running on a Macintosh with a 9-inch screen, the window
  903. sizes when either of these options is checked are usually too small to
  904. be useful. Therefore, you may want to turn these options off if you have
  905. a small screen.
  906.  
  907. ---
  908.  
  909. Parting Shots
  910.  
  911. Be sure to read the "About BBEdit Lite" document which comes with the
  912. BBEdit Lite software package for complete information on the license
  913. requirements and other details. If you wish to get in touch with us for
  914. any reason, here's how:
  915.  
  916. Postal:        Bare Bones Software, Inc.
  917.             P.O. Box 1048
  918.             Bedford, MA  01730-1048
  919.  
  920. Web page:    http://www.tiac.net/biz/bbsw/
  921.  
  922. Email:      bbsw@netcom.com
  923.  
  924. Phone:      +1 508 651 3561
  925. Fax:        +1 508 651 7584
  926.  
  927. Please note that we cannot provide technical support for BBEdit Lite or
  928. our other freeware products via phone or fax; however, if you contact us
  929. via email, we will be happy to assist you.
  930.  
  931. =============================================================================
  932. All products mentioned are trademarks or registered trademarks of their 
  933. respective holders.
  934.  
  935. This document is written by and copyright (c)1995-1996 by Bare Bones Software, 
  936. Inc. It may be redistributed freely as long as it is not modified in any 
  937. way. Information presented here is accurate as of the time of writing, but 
  938. is subject to change without notice.
  939.  
  940. BBEdit Lite is copyright (c)1992-1996 Bare Bones Software, Inc., all
  941. rights reserved. Please see the enclosed informational material for
  942. license requirements.
  943.  
  944. =end=
  945.